import Vue from 'vue';
import Vuex from 'vuex';


Vue.use(Vuex)
export default new Vuex.Store({
	state: {
        showloading: false,
        tabBarActive: 0,
        title: '考勤打卡',
        rightText: '设置',
        titleObj: {
            0: '考勤打卡',
            1: '签到统计',
            2: '外勤审批',
            3: '补卡申请',
        },

        inOrOutFlag: null, // 1内勤  2 外勤
	},
	mutations: {
        changeMask(state, status) {
            if (status === 'start') {
                state.showloading = true;
            } else {
                state.showloading = false;
            }
        },
        updateTabBarActive(state, tabBarActive) {
            state.tabBarActive = tabBarActive;
            console.log(state.tabBarActive)
        },
        changeTabBar(state, page){
            page == 0 ? state.rightText = '设置' : state.rightText = null;
            state.title = state.titleObj[page]
        },

        updateInOrOutFlag(state, inOrOutFlag) {
            state.inOrOutFlag = inOrOutFlag;
        },
	},
	actions: {
	},
    modules: {

    }
});
